package config

import (
	"pingce/core/helper"
	"pingce/core/vars"
)

func GetDbConfig(ini_path ...string) vars.MapStr {
	__path := helper.GetRoot() + vars.DS + ".env"
	if len(ini_path) > 0 && ini_path[0] != "" {
		__path = ini_path[0]
	}

	return helper.ParseIni(__path)
}

func GetCacheConfig(ini_path ...string) vars.MapAny {
	__path := helper.GetRoot() + vars.DS + "conf" + vars.DS + "cache.ini"
	if len(ini_path) > 0 && ini_path[0] != "" {
		__path = ini_path[0]
	}

	return helper.GetCacheConfig(__path)
}
